{% init file = None %}
{% init can_edit = False %}

<span>标签</span>
{% if len(file.tags) == 0 %}
    <span>(无)</span>
{% end %}

{% for tag_info in file.tag_info_list %}
    <a class="tag lightgray large" href="{{tag_info.url}}">{{tag_info.name}}</a>
{% end %}

<div class="float-right">
    {% if can_edit %}
        <button class="btn btn-default tag-edit-btn"
            data-parent-id="{{file.parent_id}}"
            data-id="{{file.id}}"
            data-tags="{{file.tags_json}}"
            onclick="xnote.action.note.editNoteTag(this);">编辑</button>
    {% end %}
</div>


<div class="hide">
<!-- 这个功能使用频率太低了 -->
{% if file != None %}

    {% if file.priority == 1 %}
        <a class="tag system" href="{{_server_home}}/note/sticky">置顶</a>
    {% end %}

    {% if file.type == "list" %}
        <a class="btn btn-default" href="{{_server_home}}/note/list">清单</a>
    {% end %}

    {% if file.type in ("csv", "table") %}
        <a class="btn btn-default" href="{{_server_home}}/note/table">表格</a>
    {% end %}

    {% if file.type == "gallery" %}
        <a class="btn btn-default" href="{{_server_home}}/note/gallery">相册</a>
    {% end %}

    {% if file.type == "html" %}
        <a class="btn btn-default" href="{{_server_home}}/note/html">富文本</a>
    {% end %}

    {% if file.type == "log" %}
        <a class="btn btn-default" href="{{_server_home}}/note/log">日志</a>
    {% end %}

    {% if file.type in ("md", "text", "plan") %}
        <a class="tag system" href="{{_server_home}}/note/document">文档</a>
    {% end %}

    {% if file.is_public %}
        <a class="btn btn-default" href="{{_server_home}}/note/public">公开</a>
    {% end %}

{% end %}
</div>

{% include note/component/script/tag_script.html %}

